<template>
  <div>
    <common-header :tagcolo="product"></common-header>
    <common-fish :fish="fish"></common-fish>
    <assets-search></assets-search>
    <assets-searchlist></assets-searchlist>
    <assets-searchtag></assets-searchtag>
    <div style="position:relative">
      <assets-navlist></assets-navlist>
      <common-page></common-page>
      <assets-hidimg></assets-hidimg>
    </div>
    <common-footer></common-footer>

  </div>
</template>

<script>
import CommonHeader from 'common/header/Header'
import CommonFooter from 'common/footer/Footer'
import CommonFish from 'common/fish/Fish'
import CommonPage from 'common/page/Page'
import AssetsSearch from './components/search'
import AssetsSearchlist from './components/searchlist'
import AssetsSearchtag from './components/searchtag'
import AssetsNavlist from './components/navlist'
import AssetsHidimg from './components/hidimg'
import axios from 'axios'
export default {
  name: '',
  data () {
    return {
      product: {
        nav: 'assets'
      },
      fish: {
        title: '权益类资产'
      },
      param: {
        pageQty: 1,
        whereStr: '',
        whereStr1: ''
      },
      navlistdata: {
        navList:[],
        searchtag: '',
      },
      pagetotal: {
        total: 0,
        pagenum: '',
      }
    }
  },
  components: {
    CommonHeader,
    CommonFooter,
    CommonFish,
    CommonPage,
    AssetsSearch,
    AssetsSearchlist,
    AssetsSearchtag,
    AssetsNavlist,
    AssetsHidimg
  },
  methods: {
    getAssetsFinance (res) {
      axios.get('/api/cfae_java/getgoldlist?pageRowQty=8&pageQty='+res.pageQty+'&whereStr='+res.whereStr+'&whereStr1='+res.whereStr1+'&userCode=').then(this.getAssetsSuccFinance)
    },
    getAssetsMaterial (res) {

      axios.get('/api/cfae_java/getgoldlist_assets?pageRowQty=8&pageQty='+res.pageQty+'&whereStr='+res.whereStr+'&whereStr1='+res.whereStr1+'&userCode=').then(this.getAssetsSuccMaterial)
    },
    getAssetsUnhealthy (res) {

      axios.get('/api/cfae_java/getgoldlist_zhaiquan?pageRowQty=8&pageQty='+res.pageQty+'&whereStr='+res.whereStr+'&whereStr1='+res.whereStr1+'&userCode=').then(this.getAssetsSuccUnhealthy)
    },
    getAssetsAttract (res) {

      axios.get('/api/cfae_java/getgoldlist_zhaoshang?pageRowQty=8&pageQty='+res.pageQty+'&whereStr='+res.whereStr+'&whereStr1='+res.whereStr1+'&userCode=').then(this.getAssetsSuccAttract)
      // axios.get('/api/cfae_java/getgoldlist_zhaoshang?pageRowQty=8&pageQty=2&sortType=&sortObject=&whereStr=&whereStr1=&userCode=').then(this.getAssetsSuccAttract)

      // axios.get('/api/cfae_java/getgoldlist_zhaoshang?pageRowQty=8&pageQty=1&whereStr=&whereStr1=objectprice0%2F500%3Blocalzone(%27110000%27%2C%27120000%27%2C%27130000%27%2C%27140000%27%2C%27150000%27)&userCode=').then(this.getAssetsSuccAttract)
      // axios.get('/api/cfae_java/getgoldlist_zhaoshang?pageRowQty=8&pageQty=1&whereStr=&whereStr1=localzone(%27110000%27%2C%27120000%27%2C%27130000%27%2C%27140000%27%2C%27150000%27)&userCode=').then(this.getAssetsSuccAttract)
      // axios.get('api/cfae_java/getgoldlist?pageRowQty=8&pageQty=1&whereStr=%E6%9F%90%E5%86%9C%E6%9D%91%E5%95%86%E4%B8%9A%E9%93%B6&whereStr1=localzone(%27110000%27%2C%27120000%27%2C%27130000%27%2C%27140000%27%2C%27150000%27)&userCode=15585589941').then(this.getAssetsSuccAttract)

      //api/cfae_java/getgoldlist?pageRowQty=8&pageQty=1&whereStr=&whereStr1=objectprice0%2F500&userCode=15585589941
      //api/cfae_java/getgoldlist?pageRowQty=8&pageQty=1&whereStr=&whereStr1=objectprice0%2F500%3Blocalzone(%27110000%27%2C%27120000%27%2C%27130000%27%2C%27140000%27%2C%27150000%27)&userCode=15585589941
      //api/cfae_java/getgoldlist?pageRowQty=8&pageQty=1&whereStr=%E5%BB%8A%E5%9D%8A%E6%B1%87%E7%9D%A3OFF&whereStr1=objectprice0%2F500%3Blocalzone(%27110000%27%2C%27120000%27%2C%27130000%27%2C%27140000%27%2C%27150000%27)&userCode=15585589941

      //api/cfae_java/getgoldlist?pageRowQty=8&pageQty=1&whereStr=&whereStr1=objectprice0/500&userCode=15585589941
      //api/cfae_java/getgoldlist?pageRowQty=8&pageQty=1&whereStr=&whereStr1=objectprice0/500;localzone('110000','120000','130000','140000','150000')&userCode=15585589941
      //api/cfae_java/getgoldlist?pageRowQty=8&pageQty=1&whereStr=å»åæ±ç£OFF&whereStr1=objectprice0/500;localzone('110000','120000','130000','140000','150000')&userCode=15585589941
    },
    getAssetsFinanceTotal (res) {
      axios.get('/api/cfae_java/getgoldlist_qty?pageRowQty=8&pageQty=1&whereStr='+res.whereStr+'&whereStr1='+res.whereStr1+'&userCode=').then(this.getAssetsSuccFinanceTotal)
    },
    getAssetsMaterialTotal (res) {
      axios.get('/api/cfae_java/getgoldlist_assets_qty?whereStr='+res.whereStr+'&whereStr1='+res.whereStr1+'&userCode=').then(this.getAssetsSuccMateriaTotal)
    },
    getAssetsUnhealthyTotal (res) {
      axios.get('/api/cfae_java/getgoldlist_zhaiquan_qty?whereStr='+res.whereStr+'&whereStr1='+res.whereStr1+'&userCode=').then(this.getAssetsSuccUnhealthyTotal)
    },
    getAssetsAttractTotal (res) {

      axios.get('/api/cfae_java/getgoldlist_zhaoshang_qty?whereStr='+res.whereStr+'&whereStr1='+res.whereStr1+'&userCode=').then(this.getAssetsSuccAttractTotal)
    },
    getAssetsSuccFinance (res) {
      res = res.data
      this.navlistdata.navList = res
      // this.navlistdata.searchtag = this.param.whereStr1
      this.bus.$emit('navlist',this.navlistdata)
    },
    getAssetsSuccMaterial (res) {
      res = res.data
      this.navlistdata.navList = res
      // this.navlistdata.searchtag = this.param.whereStr1
      this.bus.$emit('navlist',this.navlistdata)
    },
    getAssetsSuccUnhealthy (res) {
      res = res.data
      this.navlistdata.navList = res
      // this.navlistdata.searchtag = this.param.whereStr1
      this.bus.$emit('navlist',this.navlistdata)
    },
    getAssetsSuccAttract (res) {
      res = res.data
      this.navlistdata.navList = res
      // this.navlistdata.searchtag = this.param.whereStr1
      this.bus.$emit('navlist',this.navlistdata)
    },


    getAssetsSuccFinanceTotal (res) {
      res = res.data
      this.pagetotal.total = res
      this.bus.$emit('navtotal',this.pagetotal)
    },
    getAssetsSuccMateriaTotal (res) {
      res = res.data
      this.pagetotal.total = res
      this.bus.$emit('navtotal',this.pagetotal)
    },
    getAssetsSuccUnhealthyTotal (res) {
      res = res.data
      this.pagetotal.total = res
      this.bus.$emit('navtotal',this.pagetotal)
    },
    getAssetsSuccAttractTotal (res) {
      res = res.data
      this.pagetotal.total = res
      this.bus.$emit('navtotal',this.pagetotal)
    }
  },
  created () {
    var this_ = this
    this.bus.$on('change', function() {
      this_.param.pageQty = this.AssetsType.index+1
      this_.param.whereStr = this.AssetsType.secinput
      this_.param.whereStr1 =(this.AssetsType.tabmoney?'objectprice'+this.AssetsType.tabmoney:'') + (this.AssetsType.tabregion?';localzone'+this.AssetsType.tabregion:'')
      // console.log(this.AssetsType.methodname)
      switch (this.AssetsType.methodname) {
        case 'getAssetsFinance':
          this_.getAssetsFinance(this_.param)
          this_.getAssetsFinanceTotal(this_.param)
          break;
        case 'getAssetsMaterial':
          this_.getAssetsMaterial(this_.param)
          this_.getAssetsMaterialTotal(this_.param)
          break;
        case 'getAssetsUnhealthy':
          this_.getAssetsUnhealthy(this_.param)
          this_.getAssetsUnhealthyTotal(this_.param)
          break;
        case 'getAssetsAttract':
          this_.getAssetsAttract(this_.param)
          this_.getAssetsAttractTotal(this_.param)

          break;
        default:

      }
    })

  },
  beforeDestroy () {
    this.bus.$off('navlist')
    this.bus.$off('navtotal')
  }
}
</script>

<style scoped type="text/stylus" lang="stylus">

</style>
